package com.bw.shopping.mvvm.model;

import com.bw.mvvm_common.entity.BaseEntity;
import com.bw.mvvm_common.mvvm.model.BaseModel;
import com.bw.mvvm_common.network.HttpEnum;
import com.bw.mvvm_common.network.HttpFactory;

import java.util.HashMap;

import io.reactivex.Observable;

/**
 * @author KK
 * @description:
 * @date :2021/10/28 18:45
 */
public class OrderListModel extends BaseModel {

    //订单详情
    public Observable<BaseEntity> requestOrderList(HashMap<String,Object> map){
        return changeFunc(HttpFactory.create(HttpEnum.TokenSign)
        .getRetrofit()
        .create(Api.class)
        .requestOrderList(createBody(map)));

    }

    //提交订单
    public Observable<BaseEntity> requestSubmitOrder(HashMap<String,Object> map){
        return changeFunc(HttpFactory.create(HttpEnum.Token)
                .getRetrofit()
                .create(Api.class)
                .requestSubmitOrder(createBody(map)));

    }

    //获取支付宝sign
    public Observable<BaseEntity> requestPaySign(HashMap<String,Object> map){
        return changeFunc(HttpFactory.create(HttpEnum.TokenSign)
                .getRetrofit()
                .create(Api.class)
                .requestPaySign(createBody(map)));
    }

    //支付状态
    public Observable<BaseEntity> requestPayment(HashMap<String,Object> map){
        return changeFunc(HttpFactory.create(HttpEnum.TokenSign)
                .getRetrofit()
                .create(Api.class)
                .requestPayment(createBody(map)));
    }
}
